package com.cyz.web.app.bridge;

import lombok.extern.slf4j.Slf4j;

/**
 * 桥接模式
 * 多个类的关系依赖于抽象,
 *
 */
@Slf4j
public class Client {

    public static void main(String[] args) {

        log.info("给锤子添加魔法属性");
        var hammer = new Hammer(new SoulEatingEnchantment());
        hammer.wield();
        hammer.swing();
        hammer.unWield();
        System.out.println();
        log.info("给锤子添加暴击属性");
        hammer = new Hammer(new CriticalEnchantment());
        hammer.wield();
        hammer.swing();
        hammer.unWield();

    }

}
